Imports CrystalDecisions.CrystalReports.EPFPageObjectFactory.PageObjectFactory
Imports CrystalDecisions.Shared
Imports CrystalDecisions.Shared.SubreportContext

Public Class VisorReporte

    Public Sub llenar(ByVal table As DataTable, ByVal ds As DataTable, ByVal dc As DataTable)
        Dim rep As New informe()
        rep.SetDataSource(table)
        rep.OpenSubreport("InfoEstudiante").SetDataSource(ds)
        rep.OpenSubreport("InfoGrupo").SetDataSource(dc)
        info.ReportSource = rep
    End Sub

    Public Sub salvar(ByVal table As DataTable, ByVal ds As DataTable, ByVal dc As DataTable, ByVal nom As String)
        Dim rep As New informe()
        Dim exportFileName As String = nom + ".pdf"
        Dim exportPath As String = My.Computer.FileSystem.SpecialDirectories.Desktop + "\" + exportFileName
        rep.SetDataSource(table)
        rep.OpenSubreport("InfoEstudiante").SetDataSource(ds)
        rep.OpenSubreport("InfoGrupo").SetDataSource(dc)
        rep.ExportToDisk(ExportFormatType.PortableDocFormat, exportPath)
    End Sub

End Class